package com.dubito.mappers;

import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.dubito.model.GradeStuAn;

public interface GradeStuAnMapper {

	/**
	 * 多对一查询，多的一方
	 * @param id
	 * @return
	 */
	@Select("select * from t_grade where id=#{id}")
	@Results(
			{
				@Result(id=true,column="id",property="id"),
				@Result(column="gradeName",property="gradeName"),
				@Result(column="id",property="stuAns",many=@Many(select="com.dubito.mappers.StuAnMapper.selectStuAnWithGrade"))
			}
	)
	public GradeStuAn getById(Integer id);
}
